//
//  LoadUserName.m
//  EasyToTesco2.0
//
//  Created by baozi on 16/9/29.
//  Copyright © 2016年 EasyToTesco. All rights reserved.
//

#import "LoadUserName.h"

@implementation LoadUserName


/**
 <#Description#>

 @param phoneNumber <#phoneNumber description#>
 @param ReturnTextBlock <#ReturnTextBlock description#>
 @param view <#view description#>
 */
+ (void)loadUserNameWithPhoneNumber:(NSString *)phoneNumber andCompleteUserName:(ReturnTextBlock)ReturnTextBlock and:(UIView *)view {
    
    
    [[NetWorkSharedTools sharedNetWorkTools] objectWithURLDict:@{@"username":phoneNumber} AndMenthodName:@"api/User/info" completeBlock:^(id object) {
        
        if (JudgeBackDataCode) {
            NSDictionary *dict = [object objectForKey:@"data"];
            
            
            
            NSString *userName = dict[@"xingming"];
            
            if (ReturnTextBlock) {
                ReturnTextBlock(userName);
            }
        } else {
            [MBProgressHUD showMessage:@"您输入的号码有误" toView:view dimBackground:NO AndCompleteBlock:nil];
        }
        
    }];
    
}

@end
